import { NavbarButtonUIRow } from "./NavbarButtonUIRow";
import { NavbarIconInfo } from "./NavbarIconInfo";
import { FlyToNavbarTool } from "../../award/FlyToNavbarTool";
import { Dispatcher } from "../../../../mvc/core/Dispatcher";
import { DataEvent } from "../../../events/DataEvent";
import { EventName } from "../../../mvc/EventName";
type int = number;
//class NavbarButtonManager
    
    export  class NavbarButtonManager
    {
        

        public get row2(): NavbarButtonUIRow
        {
            return this._row2;
        }

        public get row1(): NavbarButtonUIRow
        {
            return this._row1;
        }

        public init(arg1: Object /* flash.display.DisplayObjectContainer */, arg2: Array<any>, arg3: Object /* flash.display.DisplayObjectContainer */, arg4: Array<any>): void
        {
            this._row1 = new NavbarButtonUIRow();
            this._row2 = new NavbarButtonUIRow();
            this._row1BtnNames = arg2;
            this._row2BtnNames = arg4;
            this._row1.init(arg1, this._row1BtnNames);
            this._row2.init(arg3, this._row2BtnNames);
            return;
        }

        public flyAndShowBtn(arg1: NavbarIconInfo): void
        {
            this._info = arg1;
            var loc1=arg1.iconRow;
            switch (loc1) 
            {
                case NavbarButtonManager.RowNum1:
                {
                    this._row1.flyAndShowBtn(arg1, this.onFlyAndShowEnd);
                    break;
                }
                case NavbarButtonManager.RowNum2:
                {
                    this._row2.flyAndShowBtn(arg1, this.onFlyAndShowEnd);
                    break;
                }
                default:
                {
                    break;
                }
            }
            return;
        }

        public showItemDropToBtn(arg1: NavbarIconInfo): void
        {
            this._info = arg1;
            flash.utils.setTimeout(this.onFlyAndShowEnd, FlyToNavbarTool.FlyToTime * 1000);
            return;
        }

        /* internal  */onFlyAndShowEnd(): void
        {
            Dispatcher.dispatchEvent(new DataEvent(EventName.MainUIByLevelOpFinish, this._info));
            return;
        }

        public static /* const */RowNum1: int=1;

        public static /* const */RowNum2: int=2;

        /* internal */ /* var */_row1: NavbarButtonUIRow;

        /* internal */ /* var */_row2: NavbarButtonUIRow;

        /* internal */ /* var */_row1BtnNames: Array<any>;

        /* internal */ /* var */_row2BtnNames: Array<any>;

        /* internal */ /* var */_info: NavbarIconInfo;
    }
